package mysql

import "gorm.io/gorm"

type Order struct {
	gorm.Model
	Userid      int64   `gorm:"type:int;not null;"`
	GoodsId     int64   `gorm:"type:int;not null;"`
	OrderSn     string  `gorm:"type:char(36);not null;"`
	Amount      float64 `gorm:"type:decimal(10,2);not null;"`
	Payment     int64   `gorm:"tinyint(1);default:1;comment:'1支付宝2微信3银行卡'"`
	OrderStatus int64   `gorm:"tinyint(1);default:1;comment:'1已支付2待支付3已取消4已退款'"`
}

func (o *Order) Create() error {
	return DB.Debug().Create(&o).Error
}
